<?php $bar="Salary Report";?>
<?php echo form_open('payRoll');?>
<table class="tablebg" cellspacing="1" align="right" border="0" >
	<tr>
		<td>FromDate <input type="text" name="FromDate" id="Date" onclick="loadCalendar(this.id);"/></td>
		<td>ToDate <input type="text" name="ToDate" id="Date1" onclick="loadCalendar(this.id);" /></td>
		<td><input type="submit" value="Salary" id="submit" /></td>
	</tr>
	<tr height="10px">
		<td></td>
		<td></td>
		<td></td>
	</tr>
</table>
<?php if (isset($result)) { ?>
<table  id="box-table-a" cellspacing="1" align="right" border="0" width="900px">
	<tr>
		<td colspan=11 align=right class=bar><?php echo $bar;?></td>
	</tr>
	<tr>
		<th>Staff_ID</th>
		<th>BasicSalary</th>
		<th>MonthAllowance</th>				
		<th>Allowance</th>
		<th>E_SHU </th>
		<th>C_SHU </th>
		<th>PIT</th>		
		<th>Tax</th>
		<th>WorkedDay</th>
		<th>PaySalary</th>
		<th>ToTal</th>
	</tr>	
<?php $t=0; ?>
<?php foreach ($result as $row) { ?>	
	<?php 
			$total=$row->Total;
			$total = str_replace(",", "",$total);	
			$t += $total; ?>	
	
	<tr>
		<td class="row10"><?php echo $row->Staff_ID;?></td>
		<td class="row12"><?php echo $row->BasicSalary;?></td>
		<td class="row12"><?php echo $row->MonthAllowance;?></td>		
		<td class="row12"><?php echo $row->TotalAllowance;?></td>
		<td class="row10"><?php echo $row->E_SHU;?></td>
		<td class="row12"><?php echo $row->C_SHU;?></td>
		<td class="row10"><?php echo $row->PIT;?></td>		
		<td class="row12"><?php echo $row->Tax;?></td>
		<td class="row10"><?php echo $row->WorkedDay;?></td>
		<td class="row12"><?php echo $row->PaySalary;?></td>
		<td class="row10" ><?php echo $row->Total; ?></td>		
	</tr>
<?php  }?>		
	<tr>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td class="row10"> <?php echo number_format($t) ;?></td>
		
	</tr>

<?php echo form_close(); ?>
</table>
<?php
	$data['FromDate']=$FromDate;
	$data['ToDate']=$ToDate;
	
	$this->session->set_userdata($data);
?>	
 	<a href="exel/SalaryExcel">Excel</a>

<?php }?>




